home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / log.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.1 KB  |  32 lines

  1. <!--- This example shows how to use Log --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. Log Example
  6. </TITLE>
  7. </HEAD>
  8.  
  9. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  10. <BODY  bgcolor="#FFFFD5">
  11. <H3>Log Example</H3>
  12.  
  13. <CFIF IsDefined("form.number")>
  14. <CFOUTPUT>
  15. <P>Your number, #form.number#
  16. <BR>#form.number# raised to the E power: #exp(form.number)#
  17. <CFIF #form.number# LTE 0><BR>You must enter a positive real number to see the natural logarithm of that number<CFELSE><BR>The natural logarithm of #form.number#: #log("#form.number#")#</CFIF>
  18. <CFIF #form.number# LTE 0><BR>You must enter a positive real number to see the logarithm of that number to base 10<CFELSE><BR>The logarithm of #form.number# to base 10: #log10("#form.number#")#</CFIF>
  19. </CFOUTPUT>
  20. </CFIF>
  21.  
  22. <CFFORM ACTION="log.cfm" METHOD="POST">
  23. Enter a number to see its value raised to the E power,
  24. the natural logarithm of that number, and the logarithm of
  25. number to base 10.
  26. <CFINPUT TYPE="Text" NAME="number" MESSAGE="You must enter a number" VALIDATE="float" REQUIRED="No">
  27. <INPUT TYPE="Submit" NAME="">
  28. </CFFORM>
  29.  
  30. </BODY>
  31. </HTML>       
  32.